package com.lei.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lei.ssm.entity.UserAuthorityEntity;
import com.lei.ssm.mapper.UserAuthorityMapper;
import com.lei.ssm.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	@Autowired
	private UserAuthorityMapper userAuthorityMapper ;

	@Override
	public boolean add(UserAuthorityEntity user) {
		if(user!=null) {
			userAuthorityMapper.add(user);
			return true;
		}
		return false;
	}

	@Override
	public boolean update(UserAuthorityEntity user) {
		if(user!=null) {
			userAuthorityMapper.update(user);
			return true;
		}
		return false;
	}

	

	@Override
	public List<UserAuthorityEntity> listAll() {
		// TODO Auto-generated method stub
		return userAuthorityMapper.listAll();
	}

	@Override
	public UserAuthorityEntity getByName(String codeNumber) {
		// TODO Auto-generated method stub
		return userAuthorityMapper.getByName(codeNumber);
	}

	@Override
	public boolean delete(Long id) {
		if(id!=null) {
			userAuthorityMapper.delete(id);
			return true;
		}
		return false;
	}
	

}
